﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class EndGame : MonoBehaviour {

    public static EndGame _instance;

    public Button ReLoadLevel;
    public Button QuitGame;
    public Button TurnGame;
    public Text EndGameText;
    public Image Start1_full;
    public Image Start2_full;
    public Image Start3_full;


    void Awake()
    {
        _instance = this;
    }

    public void Init(string str, int i)
    {
        TurnGame.gameObject.SetActive(false);
        EndGameText.text = str;

        switch (i)
        {
            case 1:
                Start1_full.gameObject.SetActive(true);
                Start2_full.gameObject.SetActive(false);
                Start3_full.gameObject.SetActive(false);
                break;
            case 2:
                Start1_full.gameObject.SetActive(true);
                Start2_full.gameObject.SetActive(true);
                Start3_full.gameObject.SetActive(false);
                break;
            case 3:
                Start1_full.gameObject.SetActive(true);
                Start2_full.gameObject.SetActive(true);
                Start3_full.gameObject.SetActive(true);
                break;
        }
    }

    public void ReLoadLevelFuc()
    {
        TurnGame.gameObject.SetActive(true);
        this.gameObject.SetActive(true);
        Application.LoadLevel(1);
    }

    public void QuitGameFuc()
    {
        TurnGame.gameObject.SetActive(true);
        this.gameObject.SetActive(false);
        Application.Quit();
    }

}
